package com.efast.cafe.framework.enums;

import java.text.MessageFormat;

public enum ResultStatus {

	NOT_FOUND("404",""),
	SYS_ERROR("SYSTEM_ERROR","系统异常"),//系统异常
	DATA_REPEAT_ER("DATA_REPEAT","数据重复"),//数据重复 违反唯一约束
	PARAM_ERROR("PARAM_ERROR","参数{0}错误 "),//参数错误
	VALID_ERROR("VALID_ERROR","校验未通过"),//校验错误
	SYS_BUSY("SYSTEM_BUSY","系统资源繁忙"),//系统繁忙
	DATA_VERSION_ERROR("DATA_VERSION_ERROR","数据版本已变更"),
	QUERY_ERROR("QUERY_ERROR","查询错误"),//系统繁忙
	PARAM_REQUIRED_ERROR("PARAM_REQUIRED_ERROR","参数【{0}】必填。"),
	PERMISSION_ERRIR("PERMISSION_ERRIR","没有权限操作");
	private String code;
	
	private String message;
	 
    private ResultStatus(String code,String message) {
        this.code = code;
        this.message = message;
    }
 
    public String getCode() {
        return code;
    }
 
    public String getMessage() {
		return message;
	}
	
	public String getMessage(Object...params) {
		return MessageFormat.format(message, params);
	}


	   
}
